package com.example.ioc.component;

import com.example.ioc.model.UserInfo;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Li_yizYa
 * Date: 2025/7/8
 * Time: 11:07
 */
@Component
public class UserComponent {
//    @Qualifier("userInfo1")
//    @Autowired
//    private UserInfo ui;

    @Resource(name = "userInfo1")
    private UserInfo ui;

    public void say() {
        System.out.println("UserComponent say...");
        System.out.println(ui);
    }
}
